package com.changzhi.common.mq;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Description:
 * @author: 小落
 * @date: 2021年01月14日
 */
@Slf4j
@Component
public class MqProducer {

	@Resource
	private RabbitTemplate rabbitTemplate;

	/**
	 * 发送宝箱数据
	 */
	public void sendBoxInfo(String msg){
		rabbitTemplate.convertAndSend("activity.info.fanout.exchange","box", msg);
		log.info("methodName:sendBoxInfo,finish,params={}", msg);
	}

	/**
	 * 发送推送数据
	 */
	public void sendPushInfo(String msg){
		rabbitTemplate.convertAndSend("activity.info.fanout.exchange","push", msg);
		log.info("methodName:sendPushInfo,finish,params={}", msg);
	}


	/**
	 * 发送红包数据
	 */
	public void sendRedInfo(String msg){
		rabbitTemplate.convertAndSend("activity.info.direct.exchange","red", msg);
		log.info("methodName:sendRedInfo,finish,params={}", msg);
	}

	/**
	 * 发送房间VIP消息
	 */
	public void sendChannelVipInfo(String msg){
		rabbitTemplate.convertAndSend("activity.info.direct.exchange","channelvip", msg);
		log.info("methodName:sendRedInfo,finish,params={}", msg);
	}


}
